﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace TheQuest
{
    class Ghoul: Enemy
    {
        public Ghoul(Game game, Point location)
            : base(game, location, 10)
        {
            //no need for subclass constructor; the base class hanles everything.
        }
        public override void Move(Random random)
        {
            if (HitPoints >0)
            {
                int whereToMove = random.Next(3);
                if (whereToMove == 0 || whereToMove == 1)
                {
                    base.location=Move(FindPlayerDirection(game.PlayerLocation), game.Bounduaries);
                }
                if (NearPlayer())
                {
                    game.HitPlayer(4, random);
                }
            }
        }
    }
}
